import cv2
img = cv2.imread('/home/hpclib/dataset/auburn/frames_1001.jpg') 
imgInfo = img.shape
size = (imgInfo[1],imgInfo[0])
print(size)

videoWrite = cv2.VideoWriter('/home/hpclib/dataset/auburn.avi',cv2.VideoWriter_fourcc('I', '4', '2', '0'),24,size)

file = open("out.txt") 
for line in file:
    fileName = '/home/hpclib/dataset/auburn/frames_'+str(int(line))+'.jpg'
    #print fileName
    img = cv2.imread(fileName)
    #print img.shape
    #print img

    videoWrite.write(img)


print('end!')